import time

from pom.Admin.MainPage import AdminMainPage
from pom.base import BaseDriver

class MainPage(BaseDriver):

    def __init__(self, driver):
        super(MainPage, self).__init__(driver)
        self.adminmainpage = AdminMainPage(driver)

    # 跳转到首页
    def jump_homepage(self):
        self.adminmainpage.home_page.click()

    # 跳转到实训题库
    def jump_training_bank(self):
        self.adminmainpage.training_bank.click()

    # 跳转到竞赛题库
    def jump_competation_bank(self):
        self.adminmainpage.competation_bank.click()

    # 跳转到镜像管理
    def jump_images_manage(self):
        self.adminmainpage.images_manage.click()

    # 跳转到竞赛列表
    def competation_list(self):
        self.adminmainpage.competation_list.click()

    # 跳转到大屏设置
    def jump_screen_setting(self):
        self.adminmainpage.screen_setting.click()

    # 跳转到荣誉管理
    def jump_honor_manage(self):
        self.adminmainpage.honor_manage.click()

    # 跳转到排行榜
    def jump_rank_list(self):
        self.adminmainpage.rank_list.click()

    # 跳转到留言互动
    def jump_message_board(self):
        self.adminmainpage.message_board.click()

    # 跳转到权限管理
    def jump_right_manage(self):
        self.adminmainpage.right_manage.click()

    # 退出登录
    def quit_login(self):
        self.adminmainpage.move_ele(self.adminmainpage.login_info)
        time.sleep(1)
        self.adminmainpage.Click(self.adminmainpage.quit_login)

    # 切换用户角色
    def switch_right(self):
        self.adminmainpage.move_ele(self.adminmainpage.login_info)
        time.sleep(1)
        self.adminmainpage.Click(self.adminmainpage.switch_right)






